<?php

	if(isset($_GET['Cat'])){
			DelCat($_GET['Cat']);
			echo "<meta http-equiv='refresh' content='0;index.php?page=sup-cat' />";
	}

?>


<table class="tab"><tr>
<th>Supprimer</th>
<th>Libelle</th>
<th>Nombre d'article publi&eacute;</th>
<th>Voir les articles publi&eacute;</th>
</tr>
<?php
$retour = GetCategories();
while ($donnees = mysql_fetch_array($retour))
{
?>
<tr>
	<td><?php if($donnees['libelle']!="divers"){ ?>
		 	<a <?php echo 'href = "index.php?page=sup-cat&Cat='.$donnees['ID_categorie'].'"'; ?>> 
		 		<img class="icon" src="images/globe.png" alt="suppression"/></a>
		 	<?php } else { echo "-"; } ?>
	</td>	<td><?php echo $donnees['libelle']; ?></td>
	<td><?php echo NbArticlesCat($donnees['ID_categorie']); ?></td>
	<td><a 
		 <?php echo 'href = "index.php?NPage=1&Cat='.$donnees['ID_categorie'].'"'; ?>><img class="icon" src="images/loupe.png" alt="voir"/></a></td>
</tr>
<?php
}
?>
</table>
